package com.hand.pp.service.impl;/**
 * @author Estelle@앙수청
 * @date 2019/7/16 19:37
 */

import com.hand.pp.domain.Role;
import com.hand.pp.mapper.RoleMapper;
import com.hand.pp.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *  @author Estelle@앙수청
 *  @date 2019/7/16 19:37
 */
@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleMapper roleMapper;
    @Override
    public List<Role> queryAllRole() {
        return roleMapper.queryAllRole();
    }

    @Override
    public Long insertRole() {
        Role role = new Role();
        role.setId(34);
        role.setName("黄踢踢");
        role.setUser_id(5);
        role.setCode("dancer");
        role.setDescription("文艺人员");
        return roleMapper.insertRole(role);
    }

    @Override
    public void updateRole() {
        Role role = new Role();
        role.setId(34);
        role.setName("黄tt");
        role.setUser_id(5);
        role.setCode("singer");
        role.setDescription("文艺人员");
        roleMapper.updateRole(role);
    }

    @Override
    public void deleteRole(Long id) {
        roleMapper.deleteRole(id);
    }
}
